package com.huabo.sql.filter;

import com.alibaba.druid.filter.FilterEventAdapter;
import com.alibaba.druid.proxy.jdbc.ResultSetProxy;
import com.alibaba.druid.proxy.jdbc.StatementProxy;
import org.apache.log4j.Logger;

/**
 * 数据权限SQL拦截器
 * Created by Jackie Liu on 2017/7/4.
 */
public class DataAuthorityFilter extends FilterEventAdapter {

    private static final Logger log = Logger.getLogger(DataAuthorityFilter.class);

    @Override
    protected void statementExecuteQueryBefore(StatementProxy statement, String sql) {
        //System.out.println("########################### statementExecuteQueryBefore = " + sql);
        super.statementExecuteQueryBefore(statement, sql);
    }

    @Override
    protected void statementExecuteQueryAfter(StatementProxy statement, String sql, ResultSetProxy resultSet) {
        //System.out.println("########################### statementExecuteQueryAfter = " + sql);
        super.statementExecuteQueryAfter(statement, sql, resultSet);
    }
}
